/*******************************************************************************
 * Copyright (c) 2011 Bruno Quoitin.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Bruno Quoitin - initial API and implementation
 ******************************************************************************/
package reso.examples.gobackn.application;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import reso.common.AbstractApplication;
import reso.examples.gobackn.transport.DummyProtocol;
import reso.examples.gobackn.transport.TransportHost;
import reso.examples.gobackn.transport.TransportLayer;

public class AppReceiver extends AbstractApplication {
	private static final Logger LOGGER = LogManager.getLogger(AppReceiver.class);

	protected final TransportLayer tr;

	public AppReceiver(TransportHost host) {
		super(host, "receiver");
		tr = host.getTransportLayer();
	}

	public void start() {
		LOGGER.info("LISTEN - "+DummyProtocol.class.getSimpleName()+" sur le port "+DummyProtocol.PORT_LISTENER_DUMMY);
		tr.addListener(DummyProtocol.PORT_LISTENER_DUMMY, new DummyProtocol(
				(TransportHost) host));
	}

	public void stop() {
	}

}
